﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Orchard.Themes;
using Hub.Models;
using Hub.Services;

namespace Hub.Controllers {

    [Themed]
    public class ShareController : Controller {

        private readonly IHubService _hubService;

        public ShareController(IHubService hubService) {
            _hubService = hubService;
        }

        public ActionResult Index(int? id) {
            if (id.HasValue) {
                var content = _hubService.RetriveMapping(id.Value);
                if (content != null) {
                    ViewBag.Title = content.Title;
                    ViewBag.Description = content.Description;
                    ViewBag.PictureUrl = content.PictureUrl;
                }
            }

            return View();
        }

    }
}
